package com.pocketsweet.ui;
import java.util.ArrayList;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.pocketsweet.R;
import com.pocketsweet.chat.ui.activity.BaseActivity;

public class PictureViewActivity extends BaseActivity 
{
	
	// 屏幕宽度
	public static int screenWidth;
	// 屏幕高度
	public static int screenHeight;
	
	public static ArrayList<String> ImageList = new ArrayList<String>();
	public static int currentIndex=0;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Intent intent = getIntent();
		ImageList = intent.getStringArrayListExtra("ImageList");
		currentIndex = intent.getIntExtra("index", 0);

		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.picture_view_activity);
		ImageView imagLoad = (ImageView)findViewById(R.id.imagLoad);
		Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(
				this, R.anim.loading_animation);
		// 使用ImageView显示动画
		imagLoad.startAnimation(hyperspaceJumpAnimation);
		  //初始化接口，应用启动的时候调用 
		initViews();

	}

	private void initViews() {

		screenWidth = getWindow().getWindowManager().getDefaultDisplay()
				.getWidth();
		screenHeight = getWindow().getWindowManager().getDefaultDisplay()
				.getHeight();

	}
	 
	
	public void back(View v) {
		this.finish();
	}
//	
//	@Override
//	protected void onDestroy() {
//		System.gc();
//		super.onDestroy();
//	}
	
	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
	}
}